feat(room): implement room layout with organizer/guest role switching via cookies#70
Merged
underscorekadji merged 6 commits intomainfrom Aug 7, 2025
Merged
feat(room): implement room layout with organizer/guest role switching via cookies#70underscorekadji merged 6 commits intomainfrom
underscorekadji merged 6 commits intomainfrom
Conversation
…el functionality - Add role detection service with cookie-based persistence - Implement responsive 3-column layout (desktop) and single-column stack (mobile) - Create ParticipantsList component with add/disable/finish controls for organizer - Build animated Wheel component with framer-motion spin animation - Add TimerPanel with countdown, color coding, and control buttons - Include RoomTitle with copy URL button for organizer - Implement collapsible Instructions component with role-specific content - Add RoomLayout orchestrator with mock data integration - Support organizer vs guest role switching via cookies - All components styled with Tailwind CSS following design requirements Co-authored-by: underscorekadji <3449713+underscorekadji@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [2.2] Room Layout (Organizer / Guest switch via cookie)
feat(room): implement room layout with organizer/guest role switching via cookies
Aug 5, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive room layout system with role-based UI switching between organizer and guest views using cookie-based role detection. The implementation provides a complete room experience with participants management, spinning wheel functionality, timer controls, and responsive design.
- Cookie-based role detection where first visitor becomes organizer, subsequent users are guests
- Complete responsive layout with desktop 3-column grid and mobile single-column stack
- Interactive spinning wheel with time picker modal and smooth animations using framer-motion
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/room/utils/role-detection.ts | Cookie-based role detection service for organizer/guest assignment |
| src/app/room/components/Wheel.tsx | Animated spinning wheel component with participant selection |
| src/app/room/components/TimerPanel.tsx | Real-time countdown timer with color-coded warnings |
| src/app/room/components/RoomTitle.tsx | Room header with role display and URL sharing functionality |
| src/app/room/components/RoomLayout.tsx | Main layout orchestrator handling state and responsive grid |
| src/app/room/components/ParticipantsList.tsx | Participant management with add/enable/disable controls |
| src/app/room/components/Instructions.tsx | Collapsible role-specific instructions panel |
| src/app/room/[id]/page.tsx | Room page implementation using the layout component |
| package.json | Added framer-motion dependency for animations |
Comments suppressed due to low confidence (1)
src/app/room/utils/role-detection.ts:48
- The role detection logic is inverted. On first visit,
isOrganizer()returns false because no cookie exists, but thensetAsOrganizer()is called. This means the first visitor will always be treated as a guest initially, which contradicts the intended behavior of making the first visitor the organizer.
*/
…and improved spinning logic
…display in TimerPanel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a complete room layout component system that provides role-based UI switching between Organizer and Guest views using cookie-based role detection, as specified in the requirements.
Key Features Implemented
Role Detection & Switching
Responsive Layout Design
lg:classes for proper desktop/mobile switchingComponent Architecture
Wheel Functionality
Timer & Session Management
UI/UX Polish
Technical Implementation
Screenshots
Home Page:

Guest View (Read-only):

Organizer View (Full Controls):

Active Presentation State:

Quality Assurance
The implementation provides a solid foundation for the MVP while maintaining clean architecture and excellent user experience across both organizer and guest roles.
Fixes #14.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.